﻿using kunukn.RecommendationEngine.AreaRecommendation.Code.Constants;
using kunukn.RecommendationEngine.AreaRecommendation.Code.Entities;
using kunukn.RecommendationEngine.AreaRecommendation.Controls.Element;

namespace kunukn.RecommendationEngine.AreaRecommendation.Code.Web
{
    /// <summary>
    /// Author: Kunuk Nykjaer    
    /// </summary>
    public class MyControl : System.Web.UI.UserControl
    {            
        public Item GetCurrentItem()
        {
            return ((MyPage)this.Page).CurrentItem;
        }

        protected ItemThumbnail LoadThumbnail(Item item, bool linkEnabled)
        {
            var thumbnail = (ItemThumbnail)LoadControl(Path.UC_ItemThumbnail);
            thumbnail.Name = item.Name;
            thumbnail.Color = item.Color;
            thumbnail.LinkEnabled = linkEnabled;
            return thumbnail;
        }
    }
}